#!/usr/bin/env python
# -*- coding: utf-8 -*-


class UI :
	
	def __init__(self, one_dict):
		
		self.left_max_width  = self.max_len(one_dict.keys())
		self.right_max_width = self.max_len(one_dict.values())
		self.sum_width       = self.left_max_width + self.right_max_width
			
		print("-" * (self.sum_width + 7 ))
		for k, v in one_dict.items():
			for chr in ["(", ")", "'", ","]:
				k = str(k).replace(chr, "")
				v = str(v).replace(chr, "")
			print("|", k, end = "")
			print(" " * (1 + self.left_max_width  - len(str(k))), end = "")
			print("|", v, end = "")
			print(" " * (self.right_max_width - len(str(v))), "|")
			print("-" * (self.sum_width + 7))

	def max_len(self, tuples):
		
		lens = []
		for item in tuples:
			for chr in ["(", ")", "'", ","]:
				item = str(item).replace(chr, "")
			lens.append(len(str(item)))
		
		lens.sort()
		return lens[-1]
		

